using Microsoft.IdentityModel.Protocols.WSTrust.Bindings;
using System;
using System.Security;
using System.Security.Permissions;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Security;
namespace Net35.Xrm.Sdk.Client
{
	[SecuritySafeCritical]
	[SecurityPermission(SecurityAction.Demand, Unrestricted = true)]
	public abstract class IdentityProviderTrustConfiguration
	{
		private System.ServiceModel.Security.TrustVersion _trustVersion = System.ServiceModel.Security.TrustVersion.WSTrustFeb2005;
		private System.ServiceModel.SecurityMode _securityMode = System.ServiceModel.SecurityMode.TransportWithMessageCredential;
		internal AuthenticationPolicy XrmPolicy
		{
			get;
			private set;
		}
		public abstract System.Uri Endpoint
		{
			get;
		}
		internal System.ServiceModel.Channels.Binding Binding
		{
			get
			{
				return new UserNameWSTrustBinding
				{
					TrustVersion = this._trustVersion,
					SecurityMode = this._securityMode
				};
			}
		}
		public string Policy
		{
			get;
			set;
		}
		public string LiveIdAppliesTo
		{
			get;
			set;
		}
		public string AppliesTo
		{
			get;
			set;
		}
		internal System.ServiceModel.Security.TrustVersion TrustVersion
		{
			get
			{
				return this._trustVersion;
			}
			set
			{
				this._trustVersion = value;
			}
		}
		internal System.ServiceModel.SecurityMode SecurityMode
		{
			get
			{
				return this._securityMode;
			}
			set
			{
				this._securityMode = value;
			}
		}
		internal string IssueRequestType
		{
			get
			{
				if (this.TrustVersion == System.ServiceModel.Security.TrustVersion.WSTrustFeb2005)
				{
					return "http://schemas.xmlsoap.org/ws/2005/02/trust/Issue";
				}
				return "http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue";
			}
		}
		internal IdentityProviderTrustConfiguration()
		{
		}
		internal IdentityProviderTrustConfiguration(AuthenticationPolicy xrmPolicy)
		{
			this.XrmPolicy = xrmPolicy;
		}
	}
}
